package io.gitee.yth.design.pattern.test.core.pattern.structural.decorator.code.decorator;

import io.gitee.yth.design.pattern.test.core.pattern.structural.decorator.code.Drink;

/**
 * 装饰器
 *
 * @author yth
 * @since 2023-04-26-16:15
 */
public abstract class DrinkDecorator extends Drink {

    private final Drink drink;  // 被装饰者

    public DrinkDecorator(Drink drink, String description, double price) {
        // 属性
        super(description, price);
        this.drink = drink;
    }

    @Override
    public String getDescription() {
        return drink.getDescription();
    }

    @Override
    public double getPrice() {
        return drink.getPrice();
    }


}
